﻿using YDT_SeckillService.Domain.Entities;

namespace YDT_SeckillService.Domain.Interfaces
{
    /// <summary>
    /// 秒杀商品仓储接口 - 定义秒杀商品数据访问契约
    /// </summary>
    public interface ISeckillProductRepository
    {
        /// <summary>根据ID获取秒杀商品</summary>
        Task<SeckillProduct?> GetByIdAsync(Guid id);
        /// <summary>根据商品ID获取秒杀商品</summary>
        Task<SeckillProduct?> GetByProductIdAsync(Guid productId);
        /// <summary>根据秒杀活动ID获取秒杀商品</summary>
        Task<IEnumerable<SeckillProduct>> GetBySeckillIdAsync(Guid seckillId);
        /// <summary>获取所有秒杀商品</summary>
        Task<IEnumerable<SeckillProduct>> GetAllAsync();
        /// <summary>获取热门秒杀商品</summary>
        Task<IEnumerable<SeckillProduct>> GetHotSeckillProductsAsync(int count);
        /// <summary>添加秒杀商品</summary>
        Task AddAsync(SeckillProduct seckillProduct);
        /// <summary>更新秒杀商品</summary>
        Task UpdateAsync(SeckillProduct seckillProduct);
        /// <summary>删除秒杀商品</summary>
        Task DeleteAsync(Guid id);
        /// <summary>检查秒杀商品是否存在</summary>
        Task<bool> ExistsAsync(Guid id);
    }
}
